// 放用户数据
export default {
  namespaced: true, //分模块存数据必须加
  // 1. state: {}     2. state () { return {}}
  state () {
    return {
      age: 20
    }
  },
  mutations: {
    updateAge (state, a) {
      state.age += a
    }
  },
  actions: {
    updataAgeAfter3s (store, b) {
      setTimeout(() => {
        store.commit('updateAge', b)
      }, 3000)
    }
  },
  getters: {
    abc (state) {
      return state.age * state.age
    }
  }
}
